﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CNVP.Framework;
using System.Data;
using CNVP.JShop.UI;

using CNVP.Framework.Helper;
using CNVP.Framework.Utils;

namespace CNVP.JShop.Web.Controls
{
    public partial class AllNight : System.Web.UI.Page
    {
        BLL.CNVP_Ads bll = new BLL.CNVP_Ads();
        DateTime dtnow = DateTime.Now;
        protected void Page_Load(object sender, EventArgs e)
        {


            long stampnow = Public.DateToStamp(DateTime.Now);

           
            DateTime dt1 = new DateTime(dtnow.Year, dtnow.Month, dtnow.Day, 23, 30, 00);
            DateTime dt2 = new DateTime(dtnow.Year, dtnow.Month, dtnow.Day + 1, 9, 30, 00);
            //9:30 STAMP
            long ei = Public.DateToStamp(dt1);
            //23:30 STAMP
            long el = Public.DateToStamp(dt2);
            if (ei<stampnow && stampnow<el)
            {
                //MessageUtils.Show("1234");
                StartLoad(1, ei, el);
            }
        }

        /// <summary>
        /// PageNavigator1_PageChange 的摘要说明
        /// 分页加载列表函数
        /// </summary>
        protected void StartLoad(int PageIndex, long dt1, long dt2)
        {
            int i, j;
            DataTable dt = null;
            int pageNum = 1000;
            SQLConditionInfo[] st = new SQLConditionInfo[3];
            st[0] = new SQLConditionInfo("@today", dt1.ToString());
            st[1] = new SQLConditionInfo("@tommor", dt2.ToString());
            st[2] = new SQLConditionInfo("@DisplayType", 3);
            dt = bll.GetPageForStamp(PageIndex, pageNum, out i, out j, st);

            rpList.DataSource = dt;
            rpList.DataBind();

        }
    }
}